The present invention relates generally to the field of telecommunications and, in particular, to flow control in telecommunications circuits.
In recent years, computers have become a commonplace part of life for large segments of society. Many businesses and other groups or institutions rely on vast networks of computers to share data among large numbers of users. To communicate with each other, these computers and other network devices generate serial data streams that are communicated over some medium such as a telephone line, local area network or other appropriate medium.
A serial data stream can include data as well as commands that control the communication between end stations. This is referred to as xe2x80x9cin-band communication.xe2x80x9d These commands are typically transmitted over the same transmission medium as the data and, in fact, look just like regular data. Thus, the end stations must be able to distinguish between two modes of communication: a command mode and a data mode. Data that is not intended as a command but that could be interpreted as a command is typically preceded by a signal indicating that the communication is transitioning between command and data modes.
Commands can be used for in-band xe2x80x9cflow controlxe2x80x9d in the serial communication between end stations. In-band flow control relates to controlling the transmission and receipt of data over a serial communication link. In-band flow control is typically used with asynchronous data ports. One command that is typically provided in command mode is the xe2x80x9cXOFFxe2x80x9d command or its equivalent. This command allows one end station to instruct the other end station to cease transmitting data over the serial communication link.
The speed and accuracy with which an end station responds to the XOFF command provides competing concerns for system designers. For example, some systems respond quickly to anything in the data path that looks like an XOFF command. Unfortunately, this can result in an unwanted interruption in the communication link when data is mistakenly interpreted as an XOFF command. Alternatively, some systems use procedures to assure that data that matches the XOFF command was sent in command mode before responding to the command. At today""s ever increasing data rates, this can result in data loss and other problems due to the time delay in processing the data to interpret the command.
For the reasons stated above, and for other reasons stated below which will become apparent to those skilled in the art upon reading and understanding the present specification, there is a need in the art for improved flow control for a serial communication link.
The above mentioned problems with flow control and other problems are addressed by the present invention and will be understood by reading and studying the following specification. Systems and methods are described that use a combination of hardware and software to set and reset a bit in a register to control the transmission of data from a serial port. Essentially, the hardware aspect allows the system to quickly stop transmission when a bit sequence matches a stop command and the software aspect allows the data stream to be checked to determine whether the matched bit sequence was received in command mode. Advantageously, this allows transmissions to be stopped in as little as one character time. If transmissions were inadvertently stopped, the software quickly restarts transmissions.
In one embodiment, a method for controlling a transmitter for a serial data port is provided. The method includes receiving a set of data at the serial data port. The data in the set of data is compared with a selected pattern of bits. When data in the set of data matches the selected pattern of bits, a bit in a register is set. When the bit in the register is set, transmissions stop. The method further includes processing the set of data to determine a flow control state. When processing the set of data determines that the flow control state is a first state, transmissions re-start.